// 闭环管理相关的请求
import request from '@/utils/request'



//回执表格数据
export const reqReceipt = (beginTime, endTime, countyName, type) => request.get(`/productInfo/getList?beginTime=${beginTime}&endTime=${endTime}&countyName=${countyName}&type=${type}`)

// 回执--详细(地灾、山洪)
export const reqReceiptDetail = (productId, type, county, town, sgroup, isBack, mode, msg) => request.post(`/disaster/ground/detail?productId=${productId}&type=${type}&county=${county}&town=${town}&sgroup=${sgroup}&isBack=${isBack}&mode=${mode}&msg=${msg}`)

// 根据县获取镇
export const reqTown = (county) => request.get(`town/selectTownsByCounty?county=${county}`)

// 闭环率统计数据
export const reqClosed_loopRate = (type, countyName, townName, beginTime, endTime) => request.get(`/productInfo/getRate?type=${type}&countyName=${countyName}&townName=${townName}&beginTime=${beginTime}&endTime=${endTime}`)



// 图文上传请求
import axios from 'axios'


export function mulFile(formData, token) {
    // 发起post请求 post(请求地址)  post方法会返回一个promise对象  
    const URL = 'https://816i9307t1.vicp.fun/yaqxfw/disaster/uploadImages';

    // 创建一个配置对象，用于设置请求头  
    const config = {
        headers: {
            'token': `${token}`
        }
    };

    return axios.post(
        URL,
        formData,
        config  // 将配置对象作为第三个参数传递  
    );
}

// 获取单个产品图文审核信息
export const reqImageAndTextReview = (productId) => request.get(`/disaster/checkImages?productId=${productId}`)
// 获取所有产品图文审核信息
export const reqAllImageAndTextReview = (county, town, type, beginTime, endTime) => request.get(`/disaster/checkImages?county=${county}&town=${town}&type=${type}&beginTime=${beginTime}&endTime=${endTime}`)
// 审核图文
export const postReviewGraphicsAndText = (id, status) => request.post(`/disaster/verifyImages?id=${id}&status=${status}`)